package com.example.cinema.bindingdata;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableField;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.cinema.R;

import java.util.List;

public class UserMassageItemData {
    @BindingAdapter("sendurls")
    public static void sendurl(View view,String url)
    {
        if(url==null)
        {
            return;
        }
        RequestOptions options = new RequestOptions()
                .placeholder(R.mipmap.defaut_img)
                .error(R.mipmap.defaut_img)
                .fallback(R.mipmap.defaut_img);
        Glide.with(view).load(url)
                .apply(options)
                .into((ImageView) view);
    }


    public ObservableField<String> sendnam = new ObservableField<>();//发送者名称
    public ObservableField<String> sendimg = new ObservableField<>();//发送者头像
    public ObservableField<String> sendmsg = new ObservableField<>();//消息内容

}
